#include "Position.h"

Position::Position():
	xCoordinate(0), yCoordinate(0) {
}

Position::Position(const int & x, const int & y):
	xCoordinate(x), yCoordinate(y) {
}

Position Position::center(const unsigned int & width, const unsigned int & height) {
	return Position(width / 2, height / 2);
}

Position Position::left() const {
	return Position(this->xCoordinate - 1, this->yCoordinate);
}

Position Position::up() const {
	return Position(this->xCoordinate, this->yCoordinate - 1);
}

Position Position::right() const {
	return Position(this->xCoordinate + 1, this->yCoordinate);
}

Position Position::down() const {
	return Position(this->xCoordinate, this->yCoordinate + 1);
}

bool operator ==(const Position & first, const Position & second) {
	return first.xCoordinate == second.xCoordinate && first.yCoordinate == second.yCoordinate;
}
